//
//  NSObject+Extension.swift
//  DanTangLKM
//
//  Created by LKM on 16/9/26.
//  Copyright © 2016年 LKM. All rights reserved.
//

import Foundation

extension NSObject{
    public func getTag(_ key:UnsafeRawPointer?)-> Any?{
        
        return objc_getAssociatedObject(self, key);
    }
    
    /**
     *value 可以为nil
     *不是线程安全的
     */
    public func setTag(_ key:UnsafeRawPointer?,_ value:Any?){
        objc_setAssociatedObject(self ,key, value, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        
    }
}
